﻿using PEAnalyzer.InfoDef;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PEAnalyzer.ModeView.MainPage
{
    public enum ANALYZE_STATUS
    {
        ANALYZING,
        SUCCESS,
        FAILED
    }

    public class GridViewItemModeView : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        //文件种类
        private FILE_FORMAT m_FileFormat;

        //文件名
        private string m_strFileName;

        //描述
        private string m_strMessage;

        //状态
        private ANALYZE_STATUS m_status;

        //PE数据
        private CoreInterface.PEInfo m_peInfo;

        public GridViewItemModeView()
        {
            m_strMessage = "";
            m_FileFormat = FILE_FORMAT.UNKNOWN;
            m_status = ANALYZE_STATUS.ANALYZING;
        }

        public GridViewItemModeView(string strFileName):this()
        {
            m_strFileName = strFileName;
        }

        public GridViewItemModeView(string strFileName, string strMessage):this()
        {
            m_strFileName = strFileName;
            m_strMessage = strMessage;
        }

        public string FileName
        {
            get => m_strFileName;

            set
            {
                m_strFileName = value;
                this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("FileName"));
            }
        }

        public string Message
        {
            get => m_strMessage;

            set
            {
                m_strMessage = value;
                this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Message"));
            }
        }

        public FILE_FORMAT FileFormat
        {
            get => m_FileFormat;

            set
            {
                m_FileFormat = value;
                this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("FileFormat"));
            }
        }

        public ANALYZE_STATUS Status
        {
            get => m_status;

            set
            {
                m_status = value;
                this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Status"));
            }
        }

        public CoreInterface.PEInfo PEInfo
        {
            get => m_peInfo;
            set
            {
                m_peInfo = value;
            }
        }
    }
}
